import request from '@/plugin/axios'
import { sysPath } from '@api/sys.common'

export function DepartmentList(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/department/getDepartmentTree',
    method: 'get',
    params
  })
}

export function SaveDepartment(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/department/addDepartment',
    method: 'post',
    data: params
  })
}
export function DelDepartment(params) {
  console.info(JSON.stringify(params))
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/department/deleteDepartment',
    method: 'get',
    params
  })
}
export function GetDepartment(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/department/findDepartmentById',
    method: 'get',
    params
  })
}
export function UpdateDepartment(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/department/updateDepartment',
    method: 'post',
    data: params
  })
}

export function AllDepartmentList() {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/department/getAllDepartment',
    method: 'get'
  })
}
//根据部门获取员工
export function GetStaffByDepartment(params) {
  return request({
    url: sysPath + '/hx-mart/api/v1/sys/department/getStaffByDepartment',
    method: 'get',
    params
  })
}